package com.ebupt.migu.music.system.controller;

import com.ebupt.migu.music.common.entity.ResultObject;
import com.ebupt.migu.music.system.service.AuthOrganizationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 部门信息
 * @author zhangguangkai
 */
@EnableAutoConfiguration
@Controller
@RequestMapping("/system/organization")
public class OrganizationController {
	
	@Autowired
	AuthOrganizationService organizationService;

	/**
	 * 查询全部部门信息
	 * @return 部门对象列表
	 */
	@PostMapping(value = "/queryAll", produces = MediaType.APPLICATION_JSON_VALUE)
    @ResponseBody
    public ResultObject<Object> queryAll() {
        ResultObject<Object> retObj = new ResultObject<>();
    	retObj.setData(organizationService.queryAll());
    	return retObj;
    }
}